package com.jinghua.treatment.controller;

import com.jinghua.treatment.entity.SysChildren;
import com.jinghua.treatment.service.SysChildrenService;
import io.swagger.annotations.ApiOperation;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

/**
 * 儿童情况控制器
 * Created by 王兴光 on 2018/3/26.
 */
@Controller
@RequestMapping("/children")
public class SysChildrenController {

    @Resource
    private SysChildrenService childrenService;

    @ApiOperation(value="根据儿童情况编号查询儿童情况信息")
    @GetMapping(value="/getChildrenById",params = {"childrenId"})
    @ResponseBody
    public SysChildren findChildrenById(Integer childrenId){return childrenService.selectByPrimaryKey(childrenId);};

    @ApiOperation(value="新增儿童情况信息")
    @GetMapping(value="/insertChildren")
    @ResponseBody
    public int insertChildren(SysChildren children){return childrenService.insert(children);};

    @ApiOperation(value="更新儿童情况信息")
    @GetMapping(value="/updateChildren")
    @ResponseBody
    public int updateChildren(SysChildren children){return childrenService.updateByPrimaryKey(children);};
}
